package com.ayf.payment.game.api.controller;

import com.ayf.payment.game.api.entity.Game;
import com.ayf.payment.game.api.service.GameService;
import com.ayf.payment.game.api.type.CommonConstants;
import com.ayf.payment.game.api.utils.CommonResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Description: 游戏控制层
 * @Author: zh-liang
 * @Date : 2019-12-03 14:43
 */
@RequestMapping("/v/game")
@RestController
public class GameController {

    @Autowired
    private GameService gameService;

    /**
     * 查询出所有游戏
     *
     * @return
     */
    @RequestMapping("/selectAll")
    public CommonResult<List<Game>> selectAllGame() {
        return new CommonResult<List<Game>>(CommonConstants.RETURN_SUCCESS, CommonConstants.OPERATION_SUCCESS, gameService.selectAllGame());
    }

    @RequestMapping("/link")
    public CommonResult linkGame() {

        return new CommonResult(CommonConstants.RETURN_SUCCESS, CommonConstants.OPERATION_SUCCESS,"");
    }



}
